package org.acghub.mtdb.core;

import org.acghub.mtdb.common.Lifecycle;
import org.acghub.mtdb.common.Pair;

/**
 * @author zhouhe
 */
public interface Table<K, V> extends TableMarshal<K, V>, Lifecycle<Pair<org.acghub.mtdb.common.Table, StorageEngine>>, Crud<K, V> {

    org.acghub.mtdb.common.Table meta();

    String name();

    TableCache<K, V> cache();

    TableStorage<K, V> storage();

    StorageEngine engine();

    K minKey();

    K maxKey();

    K nextKey();

    V insert(K k);

    Pair<K, V> insert();

    void onChanged(TRecord<K, V> r);
}
